From: Maxim Ermilov Date: Tue, 4 Jan 2011 19:30:03 +0000 (-0500) Subject: Factor out a function to load the default theme X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~1013^2^2~9312 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=512798f9c698b92bfe4aebb7fbc10a04d452991c;p=gnome-shell.git Factor out a function to load the default theme We will use this function elsewhere when the theme needs to be reloaded. https://bugzilla.gnome.org/show_bug.cgi?id=630428 --- diff --git a/js/ui/main.js b/js/ui/main.js index e08781bfc..86e510237 100644 --- a/js/ui/main.js +++ b/js/ui/main.js @@ -109,10 +109,7 @@ function start() { global.stage.color = DEFAULT_BACKGROUND_COLOR; global.stage.no_clear_hint = true; - let themeContext = St.ThemeContext.get_for_stage (global.stage); - let stylesheetPath = global.datadir + '/theme/gnome-shell.css'; - let theme = new St.Theme ({ application_stylesheet: stylesheetPath }); - themeContext.set_theme (theme); + loadTheme(); let shellwm = global.window_manager; shellwm.takeover_keybinding('panel_main_menu'); @@ -201,6 +198,18 @@ function start() { } } +/** + * loadTheme: + * + * Reloads the theme CSS file from the default theme. + */ +function loadTheme() { + let themeContext = St.ThemeContext.get_for_stage (global.stage); + let stylesheetPath = global.datadir + '/theme/gnome-shell.css'; + let theme = new St.Theme ({ application_stylesheet: stylesheetPath }); + themeContext.set_theme (theme); +} + /** * _log: * @category: string message type ('info', 'error')